package com.cqc.manage.service.Imp.equipmentService;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.cqc.manage.entity.Equipment;
import com.cqc.manage.mapper.EquMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class EquMessageService {



    @Autowired
    private EquMapper equMapper;


    /**
     * 获取所有设备
     * @return
     */
    public List<Equipment> getAllEqu() {
        System.out.println(("----- selectAll method test ------"));
        List<Equipment> userList = equMapper.selectList(null);
        userList.forEach(System.out::println);
        return userList;
    }


    /**
     * 根据设备名称和设备编号查询
     * @param equName
     * @param equNum
     * @return
     */
    public List<Equipment> selectOneEqu(String equName,String equNum){
        QueryWrapper<Equipment> wrapper=new QueryWrapper<>();

        wrapper.eq("equ_name",equName);
        wrapper.eq("equ_num",equNum);

        List<Equipment> equipment = equMapper.selectList(wrapper);

        return equipment;


    }



}
